<template>
  <div class="header">
    <div class="title">信息采集平台</div>
    <div class="welcome">欢迎，{{name}}</div>
    <div class="right-btn" @click="logout">
      <van-icon></van-icon>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      name: '张三'
    };
  },
  methods: {
    logout() {
      this.$dialog.confirm({
        message: '确定要退出吗?'
      }).then(() => {
        localStorage.removeItem('dspToken');
        this.$router.push('/login');
      }, () => {});
    }
  }
};
</script>

<style lang="less" scoped>
.header{
  display: flex;
  height: 112px;
  align-items: center;
  padding-left: 90px;
  background: url('../assets/images/logo.png') no-repeat left 10px center, #009AFF;
  background-size: 74px 74px;
  .title{
    color: #fff;
    font-size: 54px;
    font-weight: bold;
  }
  .welcome{
    flex: 1;
    font-size: 30px;
    color: #fff;
    align-self: flex-end;
    padding-bottom: 20px;
    text-align: right;
  }
  .right-btn{
    width: 80px;
    height: 112px;
    background: url('../assets/images/icon-leave.png') no-repeat right 10px bottom 20px;
  }
}
</style>
